using System;
using System.Collections.Generic;
using NHibernate.Search.Attributes;
using NHibernate.Search;

namespace Ic.Model
{
	#region BlockShip

	/// <summary>
	/// BlockShip object for NHibernate mapped table 'TB_BlockShip'.
	/// </summary>
	[Serializable]
	[TableInfo(TableName = "TB_BlockShip", PrimaryKey = "Id" , Columns="Id,UserId,BlockId,BlockUserType,RegDate")]
	[Indexed(Index = "BlockShip")] 
	public class BlockShip
	{
		#region Member Variables
		
		protected int _id;
		protected int _userId;
		protected int _blockId;
		protected string _blockUserType;
		protected DateTime _regDate;

		#endregion

		#region Constructors

		public BlockShip() { }

		public BlockShip( int userId, int blockId, string blockUserType, DateTime regDate )
		{
			this._userId = userId;
			this._blockId = blockId;
			this._blockUserType = blockUserType;
			this._regDate = regDate;
		}

		#endregion

		#region Public Properties

		[DocumentId]
		public virtual int Id
		{
			get {return _id;}
			set {_id = value;}
		}

		public virtual int UserId
		{
			get { return _userId; }
			set { _userId = value; }
		}

		public virtual int BlockId
		{
			get { return _blockId; }
			set { _blockId = value; }
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string BlockUserType
		{
			get { return _blockUserType; }
			set
			{
				if ( value != null && value.Length > 10)
					throw new ArgumentOutOfRangeException("Invalid value for BlockUserType", value, value.ToString());
				_blockUserType = value;
			}
		}

		public virtual DateTime RegDate
		{
			get { return _regDate; }
			set { _regDate = value; }
		}

		

		#endregion
	}
	#endregion
}